import { Actions } from "crud";
import { Account } from "./type";

export const actions: Actions<Account> = {
  // 获取数据列表
  onFetchList: (
    currentPage,
    pageSize,
    totalPage,
    searchParams,
    orderByKey,
    orderByType,
  ) => {
    console.log(
      "onFetchList: ",
      currentPage,
      pageSize,
      totalPage,
      searchParams,
      orderByKey,
      orderByType,
    );
  },

  // 获取数据详情
  onFetchDetail: (row) => {
    console.log("onFetchDetail: ", row);
    return row;
  },

  // 删除单条数据
  onDelete: (row) => {
    console.log("onDelete: ", row);
  },

  // 批量删除数据
  onDeleteBatch: (rows) => {
    console.log("onDeleteBatch: ", rows);
  },

  // 数据更新
  onUpdate: (row) => {
    console.log("onUpdate: ", row);
  },

  // 数据创建
  onCreate: (row) => {
    console.log("onCreate: ", row);
  },

  // 初始化搜索框的值
  onFormItemValueInit: (key) => {
    console.log("onFormItemValueInit: ", key);
  },
};
